<?php
class Application_Form_Editproduit extends Zend_Form
{
public function Application_Form_Editproduit($user,$page)
	{
		$this->setName("Edit");
			
		$libelle = new Zend_Form_Element_Text("EditLibelleP");
		$libelle->setLabel("Libelle : ");
		$libelle->setValue($user['libelle']);
		$libelle->setAttrib("readOnly", "true");
		
		$version = new Zend_Form_Element_Text("EditVersionP");
		$version->setLabel("Version :");
		$version->setValue($user['version']);
		
		$datePublication = new Zend_Form_Element_Text("EditPublicationP");
		$datePublication->setLabel("Date de Publication :");
		$datePublication->setValue($user['date_publication']);
		
		$description = new Zend_Form_Element_Textarea("EditDescriptionP");
		$description->setLabel("Description :");
		$description->setValue($user['description']);
		
		$responsable = new Zend_Form_Element_Select("ResponsableU");
		$responsable->setLabel("Responsable : ")->setRequired(true);
		//$responsable->addMultiOption($user['id'],$user['id_resp']);
		$table = new Application_Model_DbTable_Utilisateur();
		
		foreach ( $table->GroupeResponsable() as $c)
		{
			$responsable->addMultiOption($c->id, $c->lname);
		}
		
		
		$editButton = new Zend_Form_Element_Submit("editButton");
		$editButton->setLabel("Edit");
		
		$annulerButton = new Zend_Form_Element_Button("annulerEditButton");
		if ($page==0)
		$annulerButton->setLabel("Annuler")->setAttrib("onClick", "window.location='main'");
		else
		$annulerButton->setLabel("Annuler")->setAttrib("onClick", "window.location='../../main'");

		$resetButton = new Zend_Form_Element_Reset("resetButton");
		$resetButton->setLabel("Effacer");
		
		$this->addElements(array($libelle,$version,$datePublication,$description
		,$responsable,$editButton,$annulerButton,$resetButton));
		
	}
}
?>